package com.flyco.dialog.widget;

import android.content.Context;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.flyco.dialog.listener.OnBtnClickL;
import com.flyco.dialog.utils.CornerUtils;
import com.flyco.dialog.widget.base.BaseDialog;

public class NormalTipDialog extends BaseDialog
{
  public static final int STYLE_ONE = 0;
  public static final int STYLE_TWO = 1;
  private int bgColor = Color.parseColor("#ffffff");
  private int btnColorPress = Color.parseColor("#E3E3E3");
  private String btnText = "确定";
  private int btnTextColor = Color.parseColor("#383838");
  private float btnTextSize_SP = 17.0F;
  private String content;
  private int contentGravity = 16;
  private int contentTextColor = Color.parseColor("#383838");
  private float contentTextSize_SP = 18.0F;
  private float cornerRadius_DP = 3.0F;
  private int dividerColor = Color.parseColor("#DCDCDC");
  private boolean isTitleShow = true;
  private LinearLayout ll_container;
  private OnBtnClickL onBtnClickL;
  private int style = 0;
  private String title = "温馨提示";
  private int titleLineColor = Color.parseColor("#61AEDC");
  private float titleLineHeight_DP = 1.0F;
  private int titleTextColor = Color.parseColor("#61AEDC");
  private float titleTextSize_SP = 22.0F;
  private TextView tv_btn;
  private TextView tv_content;
  private TextView tv_title;
  private View v_line_horizontal;
  private View v_line_title;

  public NormalTipDialog(Context paramContext)
  {
    super(paramContext);
  }

  public NormalTipDialog bgColor(int paramInt)
  {
    this.bgColor = paramInt;
    return this;
  }

  public NormalTipDialog btnColorPress(int paramInt)
  {
    this.btnColorPress = paramInt;
    return this;
  }

  public NormalTipDialog btnText(String paramString)
  {
    this.btnText = paramString;
    return this;
  }

  public NormalTipDialog btnTextColor(int paramInt)
  {
    this.btnTextColor = paramInt;
    return this;
  }

  public NormalTipDialog btnTextSize(float paramFloat)
  {
    this.btnTextSize_SP = paramFloat;
    return this;
  }

  public NormalTipDialog content(String paramString)
  {
    this.content = paramString;
    return this;
  }

  public NormalTipDialog contentGravity(int paramInt)
  {
    this.contentGravity = paramInt;
    return this;
  }

  public NormalTipDialog contentTextColor(int paramInt)
  {
    this.contentTextColor = paramInt;
    return this;
  }

  public NormalTipDialog contentTextSize(float paramFloat)
  {
    this.contentTextSize_SP = paramFloat;
    return this;
  }

  public NormalTipDialog cornerRadius(float paramFloat)
  {
    this.cornerRadius_DP = paramFloat;
    return this;
  }

  public NormalTipDialog dividerColor(int paramInt)
  {
    this.dividerColor = paramInt;
    return this;
  }

  public NormalTipDialog isTitleShow(boolean paramBoolean)
  {
    this.isTitleShow = paramBoolean;
    return this;
  }

  public View onCreateView()
  {
    widthScale(0.88F);
    this.ll_container = new LinearLayout(this.context);
    this.ll_container.setOrientation(1);
    this.tv_title = new TextView(this.context);
    this.tv_title.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
    this.ll_container.addView(this.tv_title);
    this.v_line_title = new View(this.context);
    this.ll_container.addView(this.v_line_title);
    this.tv_content = new TextView(this.context);
    this.tv_content.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
    this.ll_container.addView(this.tv_content);
    this.v_line_horizontal = new View(this.context);
    this.v_line_horizontal.setLayoutParams(new LinearLayout.LayoutParams(-1, 1));
    this.ll_container.addView(this.v_line_horizontal);
    LinearLayout localLinearLayout = new LinearLayout(this.context);
    localLinearLayout.setOrientation(0);
    this.tv_btn = new TextView(this.context);
    this.tv_btn.setGravity(17);
    this.tv_btn.setLayoutParams(new LinearLayout.LayoutParams(0, dp2px(45.0F), 1.0F));
    localLinearLayout.addView(this.tv_btn);
    this.ll_container.addView(localLinearLayout);
    return this.ll_container;
  }

  public void setOnBtnClickL(OnBtnClickL paramOnBtnClickL)
  {
    this.onBtnClickL = paramOnBtnClickL;
  }

  public boolean setUiBeforShow()
  {
    float f = dp2px(this.cornerRadius_DP);
    int j;
    label92: String str;
    label110: int i;
    if (this.style == 0)
    {
      this.tv_title.setMinHeight(dp2px(48.0F));
      this.tv_title.setGravity(16);
      this.tv_title.setPadding(dp2px(15.0F), dp2px(5.0F), dp2px(0.0F), dp2px(5.0F));
      TextView localTextView2 = this.tv_title;
      if (this.isTitleShow)
      {
        j = 0;
        localTextView2.setVisibility(j);
        TextView localTextView1 = this.tv_title;
        if (!TextUtils.isEmpty(this.title))
          break label450;
        str = "温馨提示";
        localTextView1.setText(str);
        this.tv_title.setTextColor(this.titleTextColor);
        this.tv_title.setTextSize(2, this.titleTextSize_SP);
        this.v_line_title.setLayoutParams(new LinearLayout.LayoutParams(-1, dp2px(this.titleLineHeight_DP)));
        this.v_line_title.setBackgroundColor(this.titleLineColor);
        View localView = this.v_line_title;
        if ((!this.isTitleShow) || (this.style != 0))
          break label458;
        i = 0;
        label195: localView.setVisibility(i);
        if (this.style != 0)
          break label465;
        this.tv_content.setPadding(dp2px(15.0F), dp2px(10.0F), dp2px(15.0F), dp2px(10.0F));
        this.tv_content.setMinHeight(dp2px(64.0F));
        this.tv_content.setGravity(this.contentGravity);
      }
    }
    while (true)
    {
      this.tv_content.setText(this.content);
      this.tv_content.setTextColor(this.contentTextColor);
      this.tv_content.setTextSize(2, this.contentTextSize_SP);
      this.tv_btn.setText(this.btnText);
      this.tv_btn.setTextColor(this.btnTextColor);
      this.tv_btn.setTextSize(2, this.btnTextSize_SP);
      this.v_line_horizontal.setBackgroundColor(this.dividerColor);
      this.ll_container.setBackgroundDrawable(CornerUtils.cornerDrawable(this.bgColor, f));
      this.tv_btn.setBackgroundDrawable(CornerUtils.listItemSelector(f, this.bgColor, this.btnColorPress, true));
      this.tv_btn.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          if (NormalTipDialog.this.onBtnClickL != null)
          {
            NormalTipDialog.this.onBtnClickL.onBtnClick();
            return;
          }
          NormalTipDialog.this.dismiss();
        }
      });
      return false;
      j = 8;
      break;
      if (this.style != 1)
        break label92;
      this.tv_title.setGravity(17);
      this.tv_title.setPadding(dp2px(0.0F), dp2px(15.0F), dp2px(0.0F), dp2px(0.0F));
      break label92;
      label450: str = this.title;
      break label110;
      label458: i = 8;
      break label195;
      label465: if (this.style == 1)
      {
        this.tv_content.setPadding(dp2px(15.0F), dp2px(7.0F), dp2px(15.0F), dp2px(20.0F));
        this.tv_content.setMinHeight(dp2px(56.0F));
        this.tv_content.setGravity(17);
      }
    }
  }

  public NormalTipDialog style(int paramInt)
  {
    this.style = paramInt;
    return this;
  }

  public NormalTipDialog title(String paramString)
  {
    this.title = paramString;
    return this;
  }

  public NormalTipDialog titleLineColor(int paramInt)
  {
    this.titleLineColor = paramInt;
    return this;
  }

  public NormalTipDialog titleLineHeight(float paramFloat)
  {
    this.titleLineHeight_DP = paramFloat;
    return this;
  }

  public NormalTipDialog titleTextColor(int paramInt)
  {
    this.titleTextColor = paramInt;
    return this;
  }

  public NormalTipDialog titleTextSize(float paramFloat)
  {
    this.titleTextSize_SP = paramFloat;
    return this;
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.flyco.dialog.widget.NormalTipDialog
 * JD-Core Version:    0.6.2
 */